<!doctype html>


<html>
<head>
  <link rel="shortcut icon" href="static/images/favicon.ico" type="image/x-icon">
  <title>requeststats.js (Closure Library API Documentation - JavaScript)</title>
  <link rel="stylesheet" href="static/css/base.css">
  <link rel="stylesheet" href="static/css/doc.css">
  <link rel="stylesheet" href="static/css/sidetree.css">
  <link rel="stylesheet" href="static/css/prettify.css">

  <script>
     var _staticFilePath = "static/";
     var _typeTreeName = "goog";
     var _fileTreeName = "Source";
  </script>

  <script src="static/js/doc.js">
  </script>


  <meta charset="utf8">
</head>

<body onload="grokdoc.onLoad();">

<div id="header">
  <div class="g-section g-tpl-50-50 g-split">
    <div class="g-unit g-first">
      <a id="logo" href="index.html">Closure Library API Documentation</a>
    </div>

    <div class="g-unit">
      <div class="g-c">
        <strong>Go to class or file:</strong>
        <input type="text" id="ac">
      </div>
    </div>
  </div>
</div>





<div class="colmask rightmenu">
<div class="colleft">
    <div class="col1">
      <!-- Column 1 start -->

<div id="title">
       <span class="fn">requeststats.js</span>
</div>

<div class="g-section g-tpl-75-25">
  <div class="g-unit g-first" id="description">
    <span class='nodesc'>No description.</span>
  </div>
  

        <div class="g-unit" id="useful-links">
          <div class="title">Useful links</div>
          <ol>
            <li><a href="local_closure_goog_labs_net_webchannel_requeststats.js.source.html"><span class='source-code-link'>Source Code</span></a></li>
            <li><a href="http://code.google.com/p/closure-library/source/browse/local/closure/goog/labs/net/webchannel/requeststats.js">Git</a></li>
          </ol>
        </div>
</div>

<h2 class="g-first">File Location</h2>
  <div class="g-section g-tpl-20-80">
    <div class="g-unit g-first">
      <div class="g-c-cell code-label">/goog/labs/net/webchannel/requeststats.js</div>
    </div>
  </div>
<hr/>


  <h2>Classes</h2>
 <div class="fn-constructor">
        <a href="class_goog_labs_net_webChannel_requestStats_ServerReachabilityEvent.html">
          goog.labs.net.webChannel.requestStats.ServerReachabilityEvent</a><br/>
        <div class="class-details">Event class for SERVER_REACHABILITY_EVENT.

</div>
 </div>
 <div class="fn-constructor">
        <a href="class_goog_labs_net_webChannel_requestStats_StatEvent.html">
          goog.labs.net.webChannel.requestStats.StatEvent</a><br/>
        <div class="class-details">Event class for STAT_EVENT.

</div>
 </div>
 <div class="fn-constructor">
        <a href="class_goog_labs_net_webChannel_requestStats_TimingEvent.html">
          goog.labs.net.webChannel.requestStats.TimingEvent</a><br/>
        <div class="class-details">Event class for requestStats.Event.TIMING_EVENT

</div>
 </div>
      
<br/>

  <div class="legend">
        <span class="key publickey"></span><span>Public</span>
        <span class="key protectedkey"></span><span>Protected</span>
        <span class="key privatekey"></span><span>Private</span>
  </div>



<h2>Enumerations</h2>






<div class="section">
  <table class="horiz-rule">


  </table>
</div>




  <h2>Global Functions</h2>





<div class="section">
  <table class="horiz-rule">


     <tr class="even entry public">
       <td class="access"></td>






  <td>
    <a name="goog.labs.net.webChannel.requestStats.getStatEventTarget"></a>


     <div class="arg">
       <img align="left" src="static/images/blank.gif">

        <span class="entryNamespace">goog.labs.net.webChannel.requestStats.</span><span class="entryName">getStatEventTarget<span class="args">()</span>
        </span>
        &#8658; <span class="type"><a href="class_goog_events_EventTarget.html">goog.events.EventTarget</a></span>
      </div>


     <div class="entryOverview">
       Returns the singleton event target for stat events.

     </div>


    <! -- Method details -->
    <div class="entryDetails">

   
      <div class="detailsSection">
        <b>Returns:</b>&nbsp;<span class="type"><a href="class_goog_events_EventTarget.html">goog.events.EventTarget</a></span>&nbsp;
            The event target for stat events.
      </div>
  
    </div>
   
  </td>


  <td class="view-code">
     <a href="local_closure_goog_labs_net_webchannel_requeststats.js.source.html#line238">code &raquo;</a>
  </td>
     </tr>


     <tr class="odd entry public">
       <td class="access"></td>






  <td>
    <a name="goog.labs.net.webChannel.requestStats.notifyServerReachabilityEvent"></a>


     <div class="arg">
       <img align="left" src="static/images/blank.gif">

        <span class="entryNamespace">goog.labs.net.webChannel.requestStats.</span><span class="entryName">notifyServerReachabilityEvent<span class="args">(<span class="arg">reachabilityType</span>)</span>
        </span>
      </div>


     <div class="entryOverview">
       Notify the channel that a particular fine grained network event has occurred.
Should be considered package-private.

     </div>


    <! -- Method details -->
    <div class="entryDetails">

      <div class="detailsSection">
        <b>Arguments: </b>






<table class="horiz-rule">
     
   <tr class="even">
     <td>
        <span class="entryName">reachabilityType</span>
        : <span class="type">requestStats.ServerReachability</span>
        <div class="entryOverview">The reachability event type.</div>
     </td>
   </tr>
  </table>
      </div>
   
  
    </div>
   
  </td>


  <td class="view-code">
     <a href="local_closure_goog_labs_net_webchannel_requeststats.js.source.html#line103">code &raquo;</a>
  </td>
     </tr>


     <tr class="even entry public">
       <td class="access"></td>






  <td>
    <a name="goog.labs.net.webChannel.requestStats.notifyStatEvent"></a>


     <div class="arg">
       <img align="left" src="static/images/blank.gif">

        <span class="entryNamespace">goog.labs.net.webChannel.requestStats.</span><span class="entryName">notifyStatEvent<span class="args">(<span class="arg">stat</span>)</span>
        </span>
      </div>


     <div class="entryOverview">
       Helper function to call the stat event callback.

     </div>


    <! -- Method details -->
    <div class="entryDetails">

      <div class="detailsSection">
        <b>Arguments: </b>






<table class="horiz-rule">
     
   <tr class="even">
     <td>
        <span class="entryName">stat</span>
        : <span class="type">requestStats.Stat</span>
        <div class="entryOverview">The stat.</div>
     </td>
   </tr>
  </table>
      </div>
   
  
    </div>
   
  </td>


  <td class="view-code">
     <a href="local_closure_goog_labs_net_webchannel_requeststats.js.source.html#line247">code &raquo;</a>
  </td>
     </tr>


     <tr class="odd entry public">
       <td class="access"></td>






  <td>
    <a name="goog.labs.net.webChannel.requestStats.notifyTimingEvent"></a>


     <div class="arg">
       <img align="left" src="static/images/blank.gif">

        <span class="entryNamespace">goog.labs.net.webChannel.requestStats.</span><span class="entryName">notifyTimingEvent<span class="args">(<span class="arg">size</span>,&nbsp;<span class="arg">rtt</span>,&nbsp;<span class="arg">retries</span>)</span>
        </span>
      </div>


     <div class="entryOverview">
       Helper function to notify listeners about POST request performance.


     </div>


    <! -- Method details -->
    <div class="entryDetails">

      <div class="detailsSection">
        <b>Arguments: </b>






<table class="horiz-rule">
     
   <tr class="even">
     <td>
        <span class="entryName">size</span>
        : <span class="type"><a href="https://developer.mozilla.org/en/Core_JavaScript_1.5_Reference/Global_Objects/Number">number</a></span>
        <div class="entryOverview">Number of characters in the POST data.</div>
     </td>
   </tr>
     
   <tr class="odd">
     <td>
        <span class="entryName">rtt</span>
        : <span class="type"><a href="https://developer.mozilla.org/en/Core_JavaScript_1.5_Reference/Global_Objects/Number">number</a></span>
        <div class="entryOverview">The amount of time from POST start to response.</div>
     </td>
   </tr>
     
   <tr class="even">
     <td>
        <span class="entryName">retries</span>
        : <span class="type"><a href="https://developer.mozilla.org/en/Core_JavaScript_1.5_Reference/Global_Objects/Number">number</a></span>
        <div class="entryOverview">The number of times the POST had to be retried.</div>
     </td>
   </tr>
  </table>
      </div>
   
  
    </div>
   
  </td>


  <td class="view-code">
     <a href="local_closure_goog_labs_net_webchannel_requeststats.js.source.html#line302">code &raquo;</a>
  </td>
     </tr>


     <tr class="even entry public">
       <td class="access"></td>






  <td>
    <a name="goog.labs.net.webChannel.requestStats.onEndExecution"></a>


     <div class="arg">
       <img align="left" src="static/images/blank.gif">

        <span class="entryNamespace">goog.labs.net.webChannel.requestStats.</span><span class="entryName">onEndExecution<span class="args">()</span>
        </span>
      </div>


     <div class="entryOverview">
       Helper function to call the end hook

     </div>

   
  </td>


  <td class="view-code">
     <a href="local_closure_goog_labs_net_webchannel_requeststats.js.source.html#line361">code &raquo;</a>
  </td>
     </tr>


     <tr class="odd entry public">
       <td class="access"></td>






  <td>
    <a name="goog.labs.net.webChannel.requestStats.onStartExecution"></a>


     <div class="arg">
       <img align="left" src="static/images/blank.gif">

        <span class="entryNamespace">goog.labs.net.webChannel.requestStats.</span><span class="entryName">onStartExecution<span class="args">()</span>
        </span>
      </div>


     <div class="entryOverview">
       Helper function to call the start hook

     </div>

   
  </td>


  <td class="view-code">
     <a href="local_closure_goog_labs_net_webchannel_requeststats.js.source.html#line353">code &raquo;</a>
  </td>
     </tr>


     <tr class="even entry public">
       <td class="access"></td>






  <td>
    <a name="goog.labs.net.webChannel.requestStats.setEndThreadExecutionHook"></a>


     <div class="arg">
       <img align="left" src="static/images/blank.gif">

        <span class="entryNamespace">goog.labs.net.webChannel.requestStats.</span><span class="entryName">setEndThreadExecutionHook<span class="args">(<span class="arg">endHook</span>)</span>
        </span>
      </div>


     <div class="entryOverview">
       Allows the application to set an execution hooks for when a channel
stops processing requests. This is useful to track timing or logging
special information. The function takes no parameters and return void.

     </div>


    <! -- Method details -->
    <div class="entryDetails">

      <div class="detailsSection">
        <b>Arguments: </b>






<table class="horiz-rule">
     
   <tr class="even">
     <td>
        <span class="entryName">endHook</span>
        : <span class="type"><a href="https://developer.mozilla.org/en/Core_JavaScript_1.5_Reference/Global_Objects/Function">Function</a></span>
        <div class="entryOverview">The function for the end hook.</div>
     </td>
   </tr>
  </table>
      </div>
   
  
    </div>
   
  </td>


  <td class="view-code">
     <a href="local_closure_goog_labs_net_webchannel_requeststats.js.source.html#line327">code &raquo;</a>
  </td>
     </tr>


     <tr class="odd entry public">
       <td class="access"></td>






  <td>
    <a name="goog.labs.net.webChannel.requestStats.setStartThreadExecutionHook"></a>


     <div class="arg">
       <img align="left" src="static/images/blank.gif">

        <span class="entryNamespace">goog.labs.net.webChannel.requestStats.</span><span class="entryName">setStartThreadExecutionHook<span class="args">(<span class="arg">startHook</span>)</span>
        </span>
      </div>


     <div class="entryOverview">
       Allows the application to set an execution hooks for when a channel
starts processing requests. This is useful to track timing or logging
special information. The function takes no parameters and return void.

     </div>


    <! -- Method details -->
    <div class="entryDetails">

      <div class="detailsSection">
        <b>Arguments: </b>






<table class="horiz-rule">
     
   <tr class="even">
     <td>
        <span class="entryName">startHook</span>
        : <span class="type"><a href="https://developer.mozilla.org/en/Core_JavaScript_1.5_Reference/Global_Objects/Function">Function</a></span>
        <div class="entryOverview">The function for the start hook.</div>
     </td>
   </tr>
  </table>
      </div>
   
  
    </div>
   
  </td>


  <td class="view-code">
     <a href="local_closure_goog_labs_net_webchannel_requeststats.js.source.html#line316">code &raquo;</a>
  </td>
     </tr>


     <tr class="even entry public">
       <td class="access"></td>






  <td>
    <a name="goog.labs.net.webChannel.requestStats.setTimeout"></a>


     <div class="arg">
       <img align="left" src="static/images/blank.gif">

        <span class="entryNamespace">goog.labs.net.webChannel.requestStats.</span><span class="entryName">setTimeout<span class="args">(<span class="arg">fn</span>,&nbsp;<span class="arg">ms</span>)</span>
        </span>
        &#8658; <span class="type"><a href="https://developer.mozilla.org/en/Core_JavaScript_1.5_Reference/Global_Objects/Number">number</a></span>
      </div>


     <div class="entryOverview">
       Wrapper around SafeTimeout which calls the start and end execution hooks
with a try...finally block.

     </div>


    <! -- Method details -->
    <div class="entryDetails">

      <div class="detailsSection">
        <b>Arguments: </b>






<table class="horiz-rule">
     
   <tr class="even">
     <td>
        <span class="entryName">fn</span>
        : <span class="type"><a href="https://developer.mozilla.org/en/Core_JavaScript_1.5_Reference/Global_Objects/Function">Function</a></span>
        <div class="entryOverview">The callback function.</div>
     </td>
   </tr>
     
   <tr class="odd">
     <td>
        <span class="entryName">ms</span>
        : <span class="type"><a href="https://developer.mozilla.org/en/Core_JavaScript_1.5_Reference/Global_Objects/Number">number</a></span>
        <div class="entryOverview">The time in MS for the timer.</div>
     </td>
   </tr>
  </table>
      </div>
   
      <div class="detailsSection">
        <b>Returns:</b>&nbsp;<span class="type"><a href="https://developer.mozilla.org/en/Core_JavaScript_1.5_Reference/Global_Objects/Number">number</a></span>&nbsp;
            The ID of the timer.
      </div>
  
    </div>
   
  </td>


  <td class="view-code">
     <a href="local_closure_goog_labs_net_webchannel_requeststats.js.source.html#line373">code &raquo;</a>
  </td>
     </tr>


  </table>
</div>






  <h2>Global Variables</h2>





<div class="section">
  <table class="horiz-rule">


     <tr class="even entry public">
       <td class="access"></td>





  <a name="goog.labs.net.webChannel.requestStats.Event.SERVER_REACHABILITY_EVENT"></a>

  <td>


     <div class="arg">
        <img align="left" src="static/images/blank.gif">

        <span class="entryName">SERVER_REACHABILITY_EVENT</span>
        : 
     </div>


     <div class="entryOverview">
       The type of event that occurs every time some information about how reachable
the server is is discovered.

     </div>

  </td>


  <td class="view-code">
     <a href="local_closure_goog_labs_net_webchannel_requeststats.js.source.html#line58">Code &raquo;</a>
  </td>
     </tr>


     <tr class="odd entry public">
       <td class="access"></td>





  <a name="goog.labs.net.webChannel.requestStats.Event.STAT_EVENT"></a>

  <td>


     <div class="arg">
        <img align="left" src="static/images/blank.gif">

        <span class="entryName">STAT_EVENT</span>
        : 
     </div>


     <div class="entryOverview">
       Stat Event that fires when things of interest happen that may be useful for
applications to know about for stats or debugging purposes.

     </div>

  </td>


  <td class="view-code">
     <a href="local_closure_goog_labs_net_webchannel_requeststats.js.source.html#line114">Code &raquo;</a>
  </td>
     </tr>


     <tr class="even entry public">
       <td class="access"></td>





  <a name="goog.labs.net.webChannel.requestStats.Event.TIMING_EVENT"></a>

  <td>


     <div class="arg">
        <img align="left" src="static/images/blank.gif">

        <span class="entryName">TIMING_EVENT</span>
        : 
     </div>


     <div class="entryOverview">
       An event that fires when POST requests complete successfully, indicating
the size of the POST and the round trip time.

     </div>

  </td>


  <td class="view-code">
     <a href="local_closure_goog_labs_net_webchannel_requeststats.js.source.html#line257">Code &raquo;</a>
  </td>
     </tr>


  </table>
</div>
      <!-- Column 1 end -->
    </div>

        <div class="col2">
          <!-- Column 2 start -->
          <div class="col2-c">
            <h2 id="ref-head">Directory webchannel</h2>
            <div id="localView"></div>
          </div>

          <div class="col2-c">
            <h2 id="ref-head">File Reference</h2>
            <div id="sideFileIndex" rootPath="" current="/goog/labs/net/webchannel/requeststats.js"></div>
          </div>
          <!-- Column 2 end -->
        </div>
</div>
</div>

</body>
</html>
